With many forms of audio processing it is very important to calculate accurate audio latency (e.g., audio delay). For example, acoustic echo cancellation (AEC) relies heavily on an audio application supplying accurate audio latency information. If the audio application does not supply accurate latency information, AEC will not work properly.
FIG. 1 is a graphical representation illustrating an example of acoustic echo. With some platforms, the audio application can call a system application programming interface (API) to obtain the audio latency. For example, the audio application on LINUX can call snd_pcm_delay( ) to obtain the audio latency. However, there are two problems associated with this. First, on some mobile platforms applications may access the audio driver; however, the audio driver does not provide APIs that can obtain the audio latency. Additionally, some platforms add an extra layer between the audio driver and the application. For example, the application may be able to access the audio driver through an “audio services” layer, which makes it more difficult to accurately calculate audio latency. FIGS. 2A and 2B illustrate this problem.
Second, on different platforms the applications must use different system APIs to obtain audio latency, which makes it difficult for developers to maintain software. Because on some platforms the audio application is unable to obtain accurate audio latency, it is necessary to use acoustic echo suppression (AES) instead of AEC, which presents additional problems since AES only suppresses echo rather than remove it.